package leetcode.median;

import java.util.Arrays;

/**
 * ClassName: $560_SubarraySum
 * Description:
 * date: 2022-02-19 17:54
 *
 * @author liyifan
 */
public class $560_SubarraySum {
    public int subarraySum(int[] nums, int k) {
        int res = 0;
        int len = nums.length;
        for (int i = 0;i < len;i++) {
            int sum = 0;
            for (int j = i;j >= 0;j--) {
                sum += nums[j];
                if (sum == k) {
                    res++;
                    break;
                }
            }
        }
        return res;
    }
}
